package com.hellowx.controller;

import com.hellowx.feignclient.HystrixClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by IntelliJ IDEA.
 *
 * @author MagicMushroom
 * @date 2021/7/13
 */
@RestController
public class TestDemoController {

    @Resource
    HystrixClient hystrixClient;

    @GetMapping("/test/{id}")
    public String test(@PathVariable("id")Integer id){

        String demo = hystrixClient.demo(id);

        System.out.println(demo)
        ;
        return "test ok !!!!id："+id;
    }
}
